import _ from 'lodash-es';
import { GetSmartDeviceModelDpSchema } from '@ray-js/panel-sdk';

export const defaultSchema = [
  {
    attr: 128,
    canTrigger: true,
    code: 'switch_led_1',
    defaultRecommend: true,
    editPermission: false,
    executable: true,
    extContent: '',
    iconname: 'icon-dp_power',
    id: 1,
    mode: 'rw',
    name: '开关1',
    property: {
      type: 'bool',
    },
    type: 'obj',
  },
  {
    attr: 128,
    canTrigger: true,
    code: 'bright_value_1',
    defaultRecommend: true,
    editPermission: false,
    executable: true,
    extContent: '',
    iconname: 'icon-liangdu1',
    id: 2,
    mode: 'rw',
    name: '亮度值1',
    property: {
      min: 10,
      max: 1000,
      scale: 0,
      step: 1,
      type: 'value',
    },
    type: 'obj',
  },
  {
    attr: 128,
    canTrigger: true,
    code: 'countdown_1',
    defaultRecommend: true,
    editPermission: false,
    executable: true,
    extContent: '',
    iconname: 'icon-a_nav_timer',
    id: 6,
    mode: 'rw',
    name: '倒计时',
    property: {
      unit: 's',
      min: 0,
      max: 86400,
      scale: 0,
      step: 1,
      type: 'value',
    },
    type: 'obj',
  },
  {
    attr: 128,
    canTrigger: true,
    code: 'scene_id_group_id',
    defaultRecommend: true,
    editPermission: false,
    executable: true,
    extContent: '',
    iconname: 'icon-a_nav_scene',
    id: 7,
    mode: 'rw',
    name: '场景ID组ID',
    property: {
      type: 'raw',
      maxlen: 255,
    },
    type: 'raw',
  },

] as const;
export const schemaMap = _.keyBy(defaultSchema, 'code') as GetSmartDeviceModelDpSchema<
  typeof defaultSchema>